import door from "./door";

/**
*
* @ author:cmd
* @ wechat:codercmd@qq.com
* @ data: 2020-03-05 15:12
*/
export default class back_door extends Laya.Script3D {
    /** @prop {name:name, tips:"提示文本", type:Node, default:null}*/

    constructor() {super();}

    onAwake() {
        console.log("door is ready");       
         
    }

    onTriggerStay(other:Laya.PhysicsCollider){
        console.log('trig back');    
        // this.owner.parent.getComponent(door).front_flag = true;   
        this.owner.parent.getComponent(Laya.Script).back_open_flag = true; 
        this.owner.parent.getComponent(Laya.Script).back_close_flag = false; 
        this.owner.parent.getComponent(Laya.Script).front_open_flag = false; 
        this.owner.parent.getComponent(Laya.Script).front_close_flag = false; 
    }

    onTriggerEnter(other:Laya.PhysicsCollider){
        console.log('enter');      
    }

    onTriggerExit(other:Laya.PhysicsCollider){
        console.log('exit back');   
        this.owner.parent.getComponent(Laya.Script).back_close_flag = true; 
        this.owner.parent.getComponent(Laya.Script).back_open_flag = false; 
        this.owner.parent.getComponent(Laya.Script).front_open_flag = false; 
        this.owner.parent.getComponent(Laya.Script).front_close_flag = false; 

    }
}